package cn.ml.gaoJi.api.indexOf;

public class IndexOfDemo2 {
    public static void main(String[] args) {
        String nn = "aa;bb;cc;dd";
        System.out.println(nn.substring(2,4));
        String[] n = nn.split(";",2);
        for (String num:n){
            System.out.println(num);
        }

        char ss = nn.charAt(6);
        System.out.println(ss);
        System.out.println("**********打印出：“小鱼儿”三个字************************");
        String word = "Hello, ";
        word = word.trim();//去空格(只去两端的空格)
        String s = word.concat("小鱼儿!");//拼接
        System.out.println("截取的是字符串的副本，本身不会变"+s+"########"+word);
        int index1 = s.indexOf(',');
        int index2 = s.indexOf('!');
        System.out.println(index1+"%%%"+index2);
        System.out.println(s.substring(index1+1,index2));

    }
}
